﻿using System;
using System.Collections.Generic;
using System.Linq;
using InvestmentIntelligence.Data.Repository.Comparers.EntityModelsComparers;
using InvestmentIntelligence.DbModel.Models;

namespace InvestmentIntelligence.Data.Repository.EFImplementation
{
    public class BookBenchmarkTypeRepository : IIPRepository<BookBenchmarkType>, IBookBenchmarkTypeRepository
    {
        public List<T> Get<T>(Func<IQueryable<BookBenchmarkType>, IEnumerable<T>> f)
        {
            return GetList(f);
        }

        public void SaveList(List<BookBenchmarkType> list)
        {
            var types = GetList();
            var newtypes = list.Except(types, new BookBenchmarkTypeComparer());
            Add(newtypes);
        }
    }
}